#include "dri_systick.h"
static uint16_t fs_us=0;
static uint16_t fs_ms=0;
void  dri_systick_init(uint8_t systick)
{
	SysTick->CTRL &= ~0x05;
	fs_us=systick/8;
	fs_ms=fs_us*1000;
	
}
void dri_systick_ms(uint16_t ms)
{
	uint32_t temp=0;
	SysTick->LOAD = fs_ms*ms;
	SysTick->CTRL |=0x01;
	do
	{
		temp=SysTick->CTRL;
	}
	while(!(temp&(0x01<<16)));
	SysTick->CTRL &= ~0x01;
	
}
void dri_systick_us(uint16_t us)
{
	uint32_t temp=0;
	SysTick->LOAD = fs_us*us;
	SysTick->CTRL |=0x01;
	do	
	{
		temp=SysTick->CTRL;
	}
	while (!(temp&(0x01<<16)));
	SysTick->CTRL &= ~0x01;
}





